package com._23DesignPattern._create.Factory.SimpleFactory;

/**
 * @Author: huangya
 * @Date: 2018/12/4
 * @Description: 简单工厂模式（01：普通工厂方法模式）
 */
public class SenderFactory1 {

    public Sender produce(String type){
        if("mail".equals(type)){
            return new MailSender();
        }else if("message".equals(type)){
            return new MessageSender();
        }else{
            return null;
        }
    }

}
